package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Pattern;

@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Schema(name = "订单分页DTO")
@Data
public class OrderPageDTO extends PageDTO implements RE {

    @Schema(description = "用户ID,用户表外键")
    private Long fkUserId;

    @Schema(description = "订单状态")
    @Range(min = 0, max = 4, message = "订单状态代码必须在0~4之间")
    private Integer status;

    @Pattern(regexp = SN_RE, message = SN_RE_MSG)
    @Schema(description = "订单编号")
    private String sn;
}
